<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<h:body>
	<h:form id="try">
		<div id="header">
			<!-- 			<h:selectOneMenu class="left" id="selectRegion" name="selectRegion" -->
			<!-- 				onchange="submit()" -->
			<!-- 				valueChangeListener="#{userPageBean.countryLocaleCodeChanged}"> -->
			<!-- 				<f:selectItems value="#{userPageBean.countriesInMap}" /> -->
			<!-- 			</h:selectOneMenu> -->
			<br />
			<h:outputText styleClass="headerUser" value="#{msg.Header_logged}" />
			<h:outputText styleClass="headerUser headerUsername"
				value="#{userLoginBean.userDTO.name}"></h:outputText>

			<p:menubar rendered="#{userBean.loggedIn}"
				style="width:90%;margin-left:auto;margin-right:auto">

				<p:submenu label="Menu" 
					style="width:auto;margin-left:auto;margin-right:auto">
					

					<p:menuitem value="Log out" action="#{userBean.logout}"
						ajax="false"></p:menuitem>
				</p:submenu>

				<p:submenu label="Users"
					style="width:auto;margin-left:auto;margin-right:auto">
					<p:menuitem value="View users" action="userView.xhtml?faces-redirect=true" ajax="false"/>
					<p:menuitem value="Add user"  rendered="#{userViewBean.loggedUser.userType == 'Owner'}" action="userAddUser.xhtml?faces-redirect=true" ajax="false"/>

				</p:submenu>

				<p:submenu label="House"
					style="width:auto;margin-left:auto;margin-right:auto">
					<p:menuitem value="View house profile" action="houseProfile.xhtml?faces-redirect=true" ajax="false"/>
					<p:menuitem value="Edit house profile" action="houseEditProfile.xhtml?faces-redirect=true" ajax="false" rendered="#{userViewBean.loggedUser.userType == 'Owner'}"/>
					<p:menuitem value="View rooms" action="mainRooms.xhtml?faces-redirect=true" ajax="false"/>

				</p:submenu>

				<p:menuitem value="Quick shutdown" action="#{userBean.houseShutdown}" ajax="false"/>

			</p:menubar>



		</div>
	</h:form>
</h:body>
</html>
